﻿@model CMS.Services.DTO.User.RegisterReponseUserModel
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>注册用户</title>
    <!-- basic styles -->
    <link href="http://cdn.zinnia.com/?type=css&path=/plugin/assets/css/bootstrap.min.css,/plugin/assets/css/font-awesome.min.css,/plugin/assets/css/font-awesome-ie7.min.css" rel="stylesheet" />
    <!--[if IE 7]>
      <link rel="stylesheet" href="http://cdn.zinnia.com/?type=css&path=/plugin/assets/css/font-awesome-ie7.min.css" />
    <![endif]-->    
    <link rel="stylesheet" href="http://cdn.zinnia.com/?type=css&path=/plugin/assets/css/ace.min.css" />   
    <!--[if lte IE 8]>
      <link rel="stylesheet" href="http://cdn.zinnia.com/?type=css&path=/plugin/assets/css/ace-ie.min.css" />
    <![endif]-->
</head>
<body>
    <div class="page-content">
        <div class="page-header">
            <h1>
                用户注册
            </h1>
        </div>
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <form id="userForm" class="form-horizontal" role="form">
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right">用户名</label>
                        <div class="col-sm-9">
                            <input type="text" name="UserName" placeholder="请输入用户名" class="col-xs-10 col-sm-5" value="@Model.UserName" />
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right">密码</label>
                        <div class="col-sm-9">
                            <input type="password" name="UserPassword" placeholder="请输入密码" class="col-xs-10 col-sm-5" value="@Model.UserPassword" />
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right">确认密码</label>
                        <div class="col-sm-9">
                            <input type="password" name="ConfirmUserPassword" placeholder="请确认密码" class="col-xs-10 col-sm-5" value="@Model.UserPassword" />
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="form-group">
                        <label class="col-sm-3 control-label no-padding-right">姓名</label>
                        <div class="col-sm-9">
                            <input type="text" name="UserRealName" placeholder="请输入姓名" class="col-xs-10 col-sm-5" value="@Model.UserRealName" />
                        </div>
                    </div>
                    <div class="space-4"></div>
                    <div class="col-md-offset-3 col-md-9">
                        <a href="javascript:;" class="btn btn-lg btn-success icon-ok">保存</a>
                        <a href="javascript:;" class="btn btn-lg btn-test icon-ok">并发测试</a>
                    </div>
                </form>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div>
    <!-- inline styles related to this page -->
    <!-- ace settings handler -->
    <script src="http://cdn.zinnia.com/?type=js&path=/plugin/assets/js/ace-extra.min.js,/plugin/jquery/jquery.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="http://cdn.zinnia.com/?type=js&path=/plugin/assets/js/html5shiv.js"></script>
    <script src="http://cdn.zinnia.com/?type=js&path=/plugin/assets/js/respond.min.js"></script>
    <![endif]-->
    <script>
        $(function() {
            $(".btn-success").click(function() {
                RegisterUser();
            });
            $(".btn-test").click(function() {
                for (var i = 0; i < 100; i++) {
                    RegisterUser();
                }
            });
        });
        //注册用户
        function RegisterUser() {
            var form = $("#userForm");
            if (!ValiadUserInfo(form)) {
                return;
            }
            SubmitUserInfo($(form).serialize());
        }

        function ValiadUserInfo(form) {
            return true;
        }
        //提交用户信息
        function SubmitUserInfo(submitData) {
            $.ajax({
                url: '/User/RegisterUser',
                type: 'POST',
                data: submitData,
                success: function (result) {
                    console.log(result);
                }
            });
        }
    </script>
</body>
</html>
